/*
 * @(#)AssociationType.java
 * Date 2013-04-10
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.registry.constant;

/**
 *
 * @author jim
 */
public enum AssociationType {

    HasMember("urn:oasis:names:tc:ebxml-regrep:AssociationType:HasMember"),
    Replace("urn:ihe:iti:2007:AssociationType:RPLC"),
    Transform("urn:ihe:iti:2007:AssociationType:XFRM"),
    Append("urn:ihe:iti:2007:AssociationType:APND"),
    TransformReplace("urn:ihe:iti:2007:AssociationType:XFRM_RPLC"),
    Signs("urn:ihe:iti:2007:AssociationType:signs");

    /** Field description */
    private final String code;

    /**
     * Constructs ...
     *
     *
     * @param code
     */
    private AssociationType(String uuid) {
        this.code = uuid;
    }

    /**
     * Method description
     *
     *
     * @param code
     *
     * @return
     */
    public static AssociationType toAssociationType(String code) {

        AssociationType result = null;

        for (AssociationType mycode : values()) {

            if (mycode.code.equals(code)) {

                result = mycode;

                break;
            }
        }

        return result;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getCode() {

        return this.code;
    }
}
